package test.继承;

import java.time.Instant;

public class Sub extends Super {

    private final Instant instant;

    Sub() {
        instant = Instant.now();
    }

    @Override
    public void overrideMe() {
        // 引起空指针
        // 父类调用overrideMe() 时，instant未初始化          
//        instant.hashCode();
        System.out.println(instant);
    }

    public static void main(String[] args) {
        Sub sub = new Sub();
        sub.overrideMe();
    }
}
